﻿using System;
using System.ComponentModel.DataAnnotations;

namespace TestOnlineProject.Models.Entities
{
    public class EditUserModel
    {
        public int UserId { get; set; }

        [Required(ErrorMessage = "Role is required")]
        public int RoleId { get; set; }

        [StringLength(15, MinimumLength = 5, ErrorMessage =
            "Username must be between 5 and 15 characters long.")]
        [Required(ErrorMessage = "Username is required")]
        public string Username { get; set; }

        [Required(ErrorMessage = "Password is required")]
        public string Password { get; set; }

        [RegularExpression(@"^[A-Za-z0-9\\+]([A-Za-z0-9])*@fpt.edu.vn$",
            ErrorMessage = "E-mail must be E-mail of FPT University")]
        [Required(ErrorMessage = "E-mail is required")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Full name is required")]
        [StringLength(50, MinimumLength = 5, ErrorMessage =
            "Full name must be between 5 and 50 characters long.")]
        public string FullName { get; set; }

        public string ImageUrl { get; set; }
        public DateTime JoinTime { get; set; }
        public bool IsActivated { get; set; }
    }
}